/**
 * 
 */
package models;

import java.util.Map;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.MapKey;
import javax.persistence.OneToMany;

import play.data.validation.Required;
import play.db.jpa.*;
import validation.Unique;

/**
 * 扩展类：定义扩展类名，扩展类最终是保存在DB4O数据库中
 * @author yujie
 *
 */
@Entity 
public class KuoZhanLei extends Model {
	/**
	 * 类名：自定义的扩展类的类名，如专家表应用情景中的专家类
	 */
	@Required
	@Unique(message = "KuoZhanLei.LeiMing.Unique")
	public String LeiMing;
	
	/**
	 * 扩展属性集合：根据扩展属性的名称来映射相应的扩展属性对象
	 * 映射关系：一个扩展类对应多个扩展属性类
	 */
	@OneToMany(cascade=CascadeType.PERSIST)
    @MapKey(name="shuXing")
    public Map<String, KuoZhanShuXing> kuoZhanShuXings;
}
